/*******************************************************************************
GTileMap.h

	Author:		LiuDingXi
	e-mail:		liudx@gmail.com
	Date time:	2009-08-07

	Copyright (C) 2009
	All rights reserved.
	
*******************************************************************************/

#ifndef _GTILEMAP_H_
#define _GTILEMAP_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "GEngine.h"
#include "GScene.h"

class GMap : public GObject
{
public:
	GMap();
	virtual ~GMap();

	BOOL DataBind(GSight* pSight, const BYTE* pBase, SceneDat::PTR ptr);

	BOOL Init(LPCTSTR szFolder, GDC* pDC);

	void OnDraw(GDC* pDC);
	bool IsVisible()const;

	void Update(UINT nMillisecond);

	BOOL GetPos(POS& refPos)const;
	BOOL GetBox(BOX& refBox)const;
	BOOL GetCxy(CXY& refCxy)const;

public:
	BOOL GetPos(int i, POS& refPos)const;
	
	SINT HitTest(int x, int y)const;

	BOOL IsValid()const;

protected:
	const BYTE*	m_pBase;
	const MAP* m_pThis;

	GImage*	m_pImages;
};

class GTileMap : public GMap
{
public:
	GTileMap();
	virtual ~GTileMap();
	
};


#endif//_GTILEMAP_H_
